/**
 * date:2019/08/16
 * author:Mr.Chung
 * description:此处放layui自定义扩展
 */

window.rootPath = (function (src) {
    src = document.scripts[document.scripts.length - 1].src;
    return src.substring(0, src.lastIndexOf("/") + 1);
})();
window.AdminPath = '/adm'
layui.config({
    base: rootPath + "lay-module/",
    version: false
}).extend({
    layuimini: "layuimini/layuimini", // layuimini扩展
    vCache:'vcache/vCache',
    treeTable: 'treetable-lay/treetable',
    http:'http/http',
    echarts:'echarts/echarts',
    echartsTheme:'echarts/echartsTheme'

    // echarts:'echarts/echarts',
  //  echartsTheme:'echarts/echartsTheme'
})
.use(['vCache'],function(){
    const query_Url = window.location.pathname;
    const token =  !layui.vCache.sGet('X-token') || layui.vCache.lGet('X-token')
    if( query_Url != AdminPath+'/l.html' && !token ){
        window.location = AdminPath+'/l.html';
    }  
})